<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body bgcolor="skyblue">
		<%
		String s1 = request.getParameter("s1");
		String s2 = request.getParameter("s2");
		int S2 = Integer.parseInt(s2);
		int result = 0;
		if(s1.equals("a")){
			for(int i = 0; i<=S2; i++){
				result = result + i;
			}
		}else if(s1.equals("b")){
			for(int i = 1; i<=S2; i++){
				result = result +  i*i;
			}
		}else {
			for(int i = 1; i<=S2; i++){
				result = result + i*i*i;
			}
		}
		%>
		您的求和结果:<%=result %><br>
</body>
</html>